package zjh_20230327;


public class OldPerson extends Childer implements Person{
    private double makeMoney;
    private int house;


    public OldPerson(){
        System.out.println("deflaut");
    }
    public OldPerson(int a){
        System.out.println("public int");
    }
    private OldPerson(double d){
        System.out.println("private double");
    }
    protected OldPerson(double c,int a){
        System.out.println("protected double,int");
    }

    public void setMakeMoney(double makeMoney) {
        this.makeMoney = makeMoney;
    }

    public int getHouse() {
        return house;
    }

    public void setHouse(int house) {
        this.house = house;
    }

    public double getMakeMoney(){
        return getHouse();
    }

    @Override
    public void say() {
        System.out.println("OldPerson -- say");
    }

    @Override
    public void writting() {
        System.out.println("OldPerson -- writting");
    }

    @Override
    public void eat() {
        System.out.println("OldPerson -- eat");
    }
}

class Childer {
    private int age;
    private String gender;
    private String name;
    Childer(){
        System.out.println("c-deafult");
    }
    public Childer(int a){
        System.out.println("c-public-int");
    }
    private Childer(double d){
        System.out.println("c-private-double");
    }

    void angry(){
        System.out.println("我生气了！！");
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}

interface Person{
    void say();
    void writting();
    void eat();
}